n=int(input())
a=list(map(int,input().split()))
max_num=max(a)
for i in range(n):
    if max_num==a[i]:
        print(max_num,i)
        break